package com.easylinkin.linkappapi.grid.controller;

import com.easylinkin.linkappapi.grid.models.dto.GridAreaImgDTO;
import com.easylinkin.linkappapi.grid.service.IGridAreaImgService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import site.morn.rest.RestMessage;


/**
 * 网格分区图 前端控制器
 *
 * @author
 * @since 2024-05-15
 */
@Api(tags = "网格分区图")
@RestController
@RequestMapping("/grid/gridAreaImg")
public class GridAreaImgController {
    @Autowired
    private IGridAreaImgService gridAreaImgService;


    /**
     * 保存
     *
     * @param gridAreaImgDTO
     * @return
     */
    @ApiOperation(value = "保存", notes = "保存")
    @PostMapping(value = "/save")
    public RestMessage save(@Validated @RequestBody GridAreaImgDTO gridAreaImgDTO) {
        return this.gridAreaImgService.saveGrifImg(gridAreaImgDTO);
    }

    /**
     * 通过id查询
     */
    @ApiOperation(value = "获取网格分区图", notes = "获取网格分区图")
    @GetMapping(value = "/queryGrifImg")
    public RestMessage queryGrifImg() {
        return gridAreaImgService.queryGrifImg();
    }
}
